﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.WCS.Domain.EntityInfo
{
    public class BytesMapObjectInfo : IEntity
    {
        [SugarColumn(IsPrimaryKey = true)]
        public long ID { get; set; }
        public long PlcReadDbId { get; set; }
        public int BytesIndex { get; set; }
        public int BytesLength { get; set; }
        public int ObjectLength { get; set; }
        [SugarColumn(IsIgnore = true)]
        public int ObjectCount { 
            get {
                    if (ObjectLength != 0)
                        return BytesLength / ObjectLength;
                    else
                        return 0;
                } 
        }
        public string ObjectName { get; set; }
    }
}
